﻿using System;
using System.ComponentModel;

namespace SteriaMummert.SharePoint.SoftwareFactoryLite.Converters
{
    public class SiteColumnTypeConverter : TypeConverter
    {
        static string[] validValues = new string[] {
                    "Attachments",
                    "Boolean",
                    "Calculated",
                    "Choice",
                    "Computed",
                    "Currency",
                    "DateTime",
                    "File",
                    "GridChoice",
                    "Guid",
                    "Integer",
                    "Lookup",
                    "LookupMulti",
                    "MultiChoice",
                    "MultiColumn",
                    "Note",
                    "Number",
                    "Text",
                    "URL",
                    "User",
                    "UserMulti",
                    "WorkflowEventType",
                    "WorkflowStatus"
         };

        public override bool IsValid(ITypeDescriptorContext context, object value)
        {
            return true;
        }

        public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
        {
            return true; //no other values allowed
        }

        public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
        {
            return true;
        }

        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            return new StandardValuesCollection(validValues);
        }
    }
}
